package com.gaoy.springdemo.server;

import com.gaoy.springdemo.mapper.MessageMapper;
import com.gaoy.springdemo.model.MessageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MessageServer {

    @Autowired
    private MessageMapper messageMapper;

    public void addMessage(MessageInfo messageInfo) {
        messageMapper.insertMessage(messageInfo);
    }

    public List<MessageInfo> queryAll() {
       return  messageMapper.queryAll();
    }
}
